<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of setting_model
 *
 * @author Administrator
 */
class Setting_model extends CI_Model {
  
  public function __construct() {
    parent::__construct();
  }
  
  public function item($key, $default_value = ''){
    $config = $this->db->get_where(DB_TABLE_CONFIG,array('key' => $key),1,0)->result();
    if(!empty($config)){
      return $config[0]->value;
    } else if(!$this->config->item($key)){
      return $this->config->item($key);
    }
    return $default_value;
  }
  
}